const path = require("path");

exports.resolve = function resolve(dir) {
  return path.join(__dirname, "..", dir);
};

exports.APP_PATH = exports.resolve("bin");
exports.DIST_PATH = exports.resolve("dist");

exports.getWebpackResolveConfig = function (customAlias = {}) {
  const appPath = path.resolve(__dirname, "..", "src");
  return {
    modules: [appPath, "node_modules"],
    extensions: [".js", ".json"],
    alias: {
      "@": appPath,
      ...customAlias,
    },
  };
};
